//
//  RW_UserSingleListViewController.m
//  SleepApp
//
//  Created by chuangqi on 2021/4/7.
//  Copyright © 2021 RiceWang. All rights reserved.
//

#import "RW_UserSingleListViewController.h"
#import "RW_UserSingleListView.h"


@interface RW_UserSingleListViewController ()
/** 基础数据 */
@property (nonatomic,strong) RW_UserSingleModel *wlclass_user_songle_model;
/** 基础视图 */
@property (nonatomic,strong) RW_UserSingleListView *wlclass_view;
/** 基础VM */
@property (nonatomic,strong) RW_UserSingleListViewModel *wlclass_view_model;

@end

@implementation RW_UserSingleListViewController
/** 进入用户歌单详情 */
+(void)pushUserSingleSongList:(RW_UserSingleModel *)user_single_model fromVc:(UIViewController *)fromVc{
    RW_UserSingleListViewController *vc = [[RW_UserSingleListViewController alloc]init];
    vc.wlclass_user_songle_model = user_single_model;
    [fromVc.navigationController pushViewController:vc animated:YES];
}
#pragma mark -- 页面初始化功能
- (void)initView{
    [self.contentView addSubview:self.wlclass_view];
    [self.wlclass_view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.insets(UIEdgeInsetsZero);
    }];
    
    [super set_title:self.wlclass_user_songle_model.name];
}
/** 首次数据刷新 */
- (void)initData{
    self.wlclass_view.wlclass_view_model = self.wlclass_view_model;
}
/** 数据刷新 */
-(void)initReloadData{
    
}
#pragma mark -- 父控制器功能
-(UIButton *)set_rightButton{
    UIButton *button = [[UIButton alloc]init];
    [button setTitle:@"编辑" forState:UIControlStateNormal];
    [button setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
    button.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
    button.tag = 1;
    return button;
}
-(void)right_button_event:(UIButton *)sender{
    if (sender.tag == 1){
        [self.wlclass_view songEditStatus:true];
        sender.tag = 2;
        [sender setTitle:@"取消" forState:UIControlStateNormal];
    } else {
        [self.wlclass_view songEditStatus:false];
        sender.tag = 1;
        [sender setTitle:@"编辑" forState:UIControlStateNormal];
    }
}

#pragma mark -- 懒加载
-(RW_UserSingleListView *)wlclass_view{
    if (!_wlclass_view){
        _wlclass_view = [[RW_UserSingleListView alloc]init];
    }
    return _wlclass_view;
}
-(RW_UserSingleListViewModel *)wlclass_view_model{
    if (!_wlclass_view_model){
        _wlclass_view_model = [[RW_UserSingleListViewModel alloc]init];
        _wlclass_view_model.wlclass_user_songle_model = self.wlclass_user_songle_model;
    }
    return _wlclass_view_model;
}

@end
